{% extends "@CoreBundle/layout/pop.html.twig" %}
{% import "@CoreBundle/macros/bind_menu.html.twig" as macros %}
{% block head_stylesheets %}
	{{ parent() }}
	{{ encore_entry_link_tags('core_role_bindmenu') }}
{% endblock %}

{% block body_javascript %}
	{{ parent() }}
	{{ encore_entry_script_tags('core_role_bindmenu') }}
{% endblock %}

{% block body_custom_javascript %}
	<script>
		var admin_api_role_bindmenu = "{{ path('admin_api_role_bindmenu', {id:info['id']}) }}";
	</script>
{% endblock %}
{% block page %}
	<div class="card card-default">
		<div class="card-header">
			<div class="btn-group">
				<button class="btn btn-primary btn-sm menu-tree-tools" data-action="expand" title="展开">
					<i class="mdi mdi-plus-box-outline"></i>&nbsp;展开
				</button>
				<button class="btn btn-primary btn-sm menu-tree-tools" data-action="collapse" title="收起">
					<i class="mdi mdi-minus-box-outline"></i>&nbsp;收起
				</button>
			</div>
			{% if info['isLock'] ==0 %}
				<div class="btn-group">
					<button class="btn btn-info btn-sm" id="menuBindSave" title="保存">
						<i class="mdi mdi-content-save"></i>
						<span class="hidden-xs">&nbsp;保存</span>
					</button>
				</div>

				<div class="icheck-primary d-inline pull-right">
					<input type="checkbox" id="menuSelectAll"><label for="menuSelectAll">全选</label>
				</div>
			{% endif %}
		</div>
		<div class="card-body table-responsive">
			<div class="dd" id="menu-tree">
				{{ macros.bind_menu(allMenu, 0, info, menuIds) }}
			</div>
		</div>
	</div>
{% endblock %}
